<?php

/**
 * Historique form base class.
 *
 * @method Historique getObject() Returns the current form's model object
 *
 * @package    jobeat
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseHistoriqueForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'attrtypeelement' => new sfWidgetFormChoice(array('choices' => array('Fichier' => 'Fichier', 'Dossier' => 'Dossier', 'Projet' => 'Projet'))),
      'attrdate'        => new sfWidgetFormInputText(),
      'attraction'      => new sfWidgetFormChoice(array('choices' => array('Suppression' => 'Suppression', 'Modification' => 'Modification', 'Ajout' => 'Ajout'))),
      'fkelement'       => new sfWidgetFormInputText(),
      'fkutilisateur'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'attrtypeelement' => new sfValidatorChoice(array('choices' => array(0 => 'Fichier', 1 => 'Dossier', 2 => 'Projet'))),
      'attrdate'        => new sfValidatorInteger(),
      'attraction'      => new sfValidatorChoice(array('choices' => array(0 => 'Suppression', 1 => 'Modification', 2 => 'Ajout'))),
      'fkelement'       => new sfValidatorInteger(),
      'fkutilisateur'   => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('historique[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Historique';
  }

}
